package com.qhy.springcloud.controller;

import com.qhy.springcloud.domain.CommonResult;
import com.qhy.springcloud.service.StorageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author qiuhongyu
 * @date 2020/12/8 10:05
 */
@RestController
public class StorageController {

    @Autowired
    private StorageService storageService;
    @PostMapping(value = "/storage/decrease")
    CommonResult decrease(@RequestParam("productId") Long productId,
                          @RequestParam("orderCount") Integer orderCount) {
        return storageService.decrease(productId, orderCount);
    }

}
